<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="moduleList" />
<script type="text/javascript">
$(document).ready(function() {
	$("#btnQuery").click(function(){
		$("#salesForm").submit();
	});
	$(".o-a-form-date").datetimepicker({
		language : 'zh-CN',
		autoclose : true,
		minView : 2,
		todayBtn : 1,
		pickerPosition : "bottom-left"
	});
});

function checkData(){
	if ($("#endDate").val().length !=0 && $("#startDate").val().length!=0) {
			if ($("#endDate").val() < $("#startDate").val()) {
				alert("结束日期小于开始日期,请重新选择日期！");
				return false;
			} else {
				return true;
			}
		}
      return  true;
	}
</script>
</head>
<body>
	<form:form name="listForm"  modelAttribute="statementMainSelfrun" method="post" class="form-inline" role="form">
	    <input type="hidden" name="deleteIds" >
		<ol class="breadcrumb map_1">
			<li><a href="${contextPath}/index">首页</a></li>
			<li><a href="${contextPath}/statement/stm/payinslip/list?navId=${navId}">采购销售</a></li>
			<li class="active">自营对账</li>
		</ol>
		<div class="o-l-search-builder f_1">
	         <div class="f_8">
	              <div class="f_2">
	                  <div class="col-sm-8 f_6">
	                       <form:input id="orderNo" path="billNo" class="f_5" placeholder="订单号"/>
	                  </div>
	                  <button type="submit" class="btn btn-warning btn_1">查&nbsp;询</button>
	             </div>
	         </div>
	         <div class="o-l-chevron-down"><a href="#" class="btn btn-default" data-toggle="collapse" data-target="#statement-search-builder" id="chevronDownBtn" role="button"><span id="glyphiconspan" class="glyphicon glyphicon-chevron-down"></span></a>
	         </div>
	     </div>
		<tags:message content="${message}"/>
		<div class="o-l-search-builder f_9">
			<table class="table table-striped table-hover o-l-table table-bordered" id="table1">
				<thead class="t_1">
					<tr>
					    <th style="width: 1px"><input type="checkbox" data-ckb="all"></th>
						<th>订单号</th>
						<th>是否已对账</th>
						<th>合同号码</th>
						<th>合同类型</th>
						<th>供应商编码</th>
						<th>供应商名称</th>
						<th>对账单状态</th>
						<th>进货金额</th>
						<th>退货金额</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${page.list}" var="statementMainSelfrun">
						<tr data-herf="${contextPath}/biz/statement/mainSelfrun/view?id=${statementMainSelfrun.id}&billNo=${statementMainSelfrun.billNo}" data-target="_self">
							<td class="o-l-tab-ckb">
								<input type="checkbox" data-ckb-id="${statementMainSelfrun.id}">
							</td>
							<td>${statementMainSelfrun.billNo}</td>
							<td><ossp:value dictType="RECONCILIATION_TYPE" key="${statementMainSelfrun.isReconciliation}"></ossp:value></td>
							<td>${statementMainSelfrun.contractNumber}</td>
							<td> <ossp:value dictType="CONTRACT_TYPE" key="${statementMainSelfrun.contractType}"></ossp:value></td>
							<td>${statementMainSelfrun.supplierNo}</td>
							<td>${statementMainSelfrun.supplierName}</td>
							<td><ossp:value dictType="BILL_STATUS" key="${statementMainSelfrun.billStatus}"></ossp:value></td>
							<td>${statementMainSelfrun.purchaseAmount}</td>
							<td>${statementMainSelfrun.returnAmount}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
        </div>
		<pager:pager pageSize="${page.pageSize}" pageNo="${page.pageNo}" url="" total="${page.total}"/>
		<script type="text/javascript" src="${staticPath}/js/list.js"></script>
  </form:form>
</body>
</html>
